﻿ #define _CRT_SECURE_NO_WARNINGS 1

int getSum(struct TreeNode* root)
{
	if (root == NULL)
		return 0;
	return getSum(root->left) + getSum(root->right) + root->val;
}
int ﬁndTilt(struct TreeNode* root)
{
	if (root == NULL)
		return 0;
	return ﬁndTilt(root->left) + ﬁndTilt(root->right) + abs(getSum(root->left) - getSum(root->right));
}